import translations from './Translations';


export default function CustomTranslate(template, replacements) {
  replacements = replacements || {};

  // Translate
  template = translations[template] || template;

  // Replace
  return template.replace(/{([^}]+)}/g, function (_, key) {
    const value = replacements[key] || '{' + key + '}';
    return translations[value] || value;
  });
}
